<?php

namespace CMBUBank\UBank\Response\TransManager;

use CMBUBank\Http\Response;
use CMBUBank\UBank\Response\UBankBaseResponse;

class TransManagerCreateSubunitResponse extends UBankBaseResponse
{
    protected $responseCode = ['ntdmabadz1'];

    /**
     * subCode 记账子单元编号
     * @var  $subCode
     */
    protected $subCode;

    /**
     * subProNo 流程实例号
     * @var  $subProNo
     */
    protected $subProNo;

    protected $isFinish;

    protected function format(): Response
    {
        return parent::formatLimit1();
    }

    protected function checkFinish()
    {
        $this->returnFlg = $this->get('rtnsts');

        if ($this->returnFlg == 'S') {
            $this->isFinish = true;
        } else {
            $this->isFinish = false;
        }

        $this->subCode = $this->bussList['dmanbr'] ?? '';
    }

    public function newSubInfo(): array
    {
        return $this->bussList;
    }

    public function getSubCode()
    {
        return $this->subCode;
    }

    public function getIsFinish()
    {
        return $this->isFinish;
    }

    public function getSubProNo()
    {
        return $this->subProNo;
    }


}